package net.pws.common.persistence.hibernate3.utils;

import java.util.UUID;

public class IdGeneratorFactory {
    
    public static IIdGenerator _instance = new IIdGenerator() {
        
        public String generate() {
            return UUID.randomUUID().toString();
        }
        
    };
    
    public static void setInstance(IIdGenerator instance) {
        if (null == instance) {
            throw new IllegalArgumentException("Null instance is not allowed!");
        }
        _instance = instance;
    }
    
    public static final IIdGenerator getInstance() {
        return _instance;
    }
    
}
